'''
CSRNet图像调色
'''

import cv2
from modelscope.outputs import OutputKeys
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

img = 'https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/image_color_enhance.png'
image_color_enhance = pipeline(Tasks.image_color_enhancement, 
                               model='damo/cv_csrnet_image-color-enhance-models')
result = image_color_enhance(img)
cv2.imwrite('enhanced_result.png', result[OutputKeys.OUTPUT_IMG])